
public class Fruit {

	private String name;	
	private double pricePerKilogram;
	public Fruit(String name, double pricePerKilogram) {

		this.name = name;
		this.pricePerKilogram = pricePerKilogram;
	}

	public Fruit(String name) {

		this.name = name;
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPricePerKilogram() {
		return pricePerKilogram;
	}

	public void setPricePerKilogram(double pricePerKilogram) {
		this.pricePerKilogram = pricePerKilogram;
	}

	public String toString() {
		return String.format("%-12s\t\t%-12.1f", this.name, this.pricePerKilogram);
	}
	

	public boolean equals(Object other) {
		if (other == null)
			return false;
		else if (getClass() != other.getClass())
			return false;
		else
		{
			Fruit otherFruits = (Fruit) other;
			return  otherFruits.name.equals(this.name);
		}
	}


}
